home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
game
/
patch
/
WHDIDemos.lzh
/
Essence_Makaveli.lha
/
MakaveliHD
/
Install-Makaveli
next >
Wrap
Text File
|
2001-11-12
|
4KB
|
195 lines
;****************************
(set #sub-dir "") ;sub directory containing data files
(set #readme-file "ReadMe") ;name of readme file
(set #highs-file "highs") ;name of high scores file
(set #cleanup "") ;files to delete after install
(set #demo "Makaveli.exe")
;****************************
;----------------------------
; checks if given program is installed, if not abort install
; #program - to check
(procedure P_ChkRun
(if
(= 0 (run ("cd SYS:\nWhich %s" #program)))
("")
(abort
(cat
"You must install \"" #program "\" first!\n"
"It must be accessible via the path.\n"
"You can find it in the \"" #package "\" package."
)
)
)
)
;----------------------------
; Wait for inserting disk
; IN: #AD_disk - name of disk
; OUT: -
(procedure P_disk
(message ("Ensure the file \"%s\" is available in RAM:" #demo))
)
;****************************
(if
(exists #readme-file)
(if
(= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
("")
(run ("SYS:Utilities/More %s" #readme-file))
)
)
(set #program "xfddecrunch")
(set #package "XFD")
(P_ChkRun)
(set #program "WHDLoad")
(set #package "WHDLoad")
(P_ChkRun)
(if
(getenv "WHDLInstPath")
(set @default-dest (getenv "WHDLInstPath"))
)
(set #dest
(askdir
(prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
(help @askdir-help)
(default @default-dest)
(disk)
)
)
(run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" @default-dest))
(set #dest (tackon #dest @app-name))
(if
(exists #dest)
(
(set #choice
(askbool
(prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
(default 1)
(choices "Delete" "Skip")
(help @askbool-help)
)
)
(if
(= #choice 1)
(run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
)
)
)
(makedir #dest
(help @makedir-help)
(infos)
)
;----------------------------
(copyfiles
(help @copyfiles-help)
(source ("%s.Slave" @app-name))
(dest #dest)
)
(if
(exists ("%s.coloricon" @app-name))
(set #icon
(askchoice
(prompt "\nWhich icon would you like to install?\n")
(default 0)
(choices "NewIcon" "ColorIcon")
(help @askchoice-help)
)
)
(set #icon 0)
)
(select #icon
(set #icon ("%s.newicon" @app-name))
(set #icon ("%s.coloricon" @app-name))
)
(copyfiles
(help @copyfiles-help)
(source #icon)
(newname ("%s.info" @app-name))
(dest #dest)
)
(tooltype
(dest (tackon #dest @app-name))
(settooltype "Slave")
(settooltype "PreLoad")
)
(tooltype
(dest (tackon #dest @app-name))
(settooltype "PreLoad" "")
(settooltype "Slave" ("%s.Slave" @app-name))
(setdefaulttool "WHDLoad")
(setstack 10240)
(noposition)
)
(if
(exists #readme-file)
(copyfiles
(help @copyfiles-help)
(source #readme-file)
(dest #dest)
)
)
(copyfiles
(help @copyfiles-help)
(source ("OSEmu.exe" @app-name))
(dest #dest)
)
(if
(exists ("%s.info" #readme-file))
(
(copyfiles
(help @copyfiles-help)
(source ("%s.info" #readme-file))
(dest #dest)
)
(tooltype
(dest (tackon #dest #readme-file))
(noposition)
)
)
)
(if
(= #sub-dir "")
("")
(
(set #dest (tackon #dest #sub-dir))
(makedir #dest
(help @makedir-help)
)
)
)
(if
(exists #highs-file)
(copyfiles
(help @copyfiles-help)
(source #highs-file)
(dest #dest)
)
)
;----------------------------
(P_Disk)
(if
(= 0 (run ("xfddecrunch RAM:%s %s >CON:///1000//CLOSE ALL" #demo #dest)))
("")
(abort "\"xfddecrunch\" has failed to decompress the demo")
)
;----------------------------
(run ("Delete %s ALL QUIET FORCE" #cleanup))
(exit)